package com.thyme.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.thyme.dao.UserDao;
import com.thyme.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author Thyme
 * @Date 2021/2/5 9:28
 * @Description TODO
 **/
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    @DS("slave")
    public int save(User user) {
        return userDao.insert(user);
    }

    @DS("master")
    public int insert(User user) {
        return userDao.insert(user);
    }
}
